# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.http import HttpResponse
from .models import Category
import json
from django.shortcuts import render

# Create your views here.
def test(request):
    res = Category.objects.all()
    content = []
    for item in res:
        content.append(item.getattrs())
    #     json 不能解析datetime等特殊字符
    return HttpResponse(json.dumps(content))

def book(request,page):
    return  HttpResponse('book'+page)